package cn.bopomo.dealer.base.service;

import java.util.List;
import java.util.Map;

import cn.bopomo.dealer.base.exception.SystemException;
import cn.bopomo.dealer.base.util.Page;
import cn.bopomo.dealer.base.vo.AuGroup;
import cn.bopomo.dealer.base.vo.AuthorizeList;
import cn.bopomo.dealer.base.vo.ModuleList;
import cn.bopomo.dealer.base.vo.OperatorDetail;

public interface IOperatorService {
	
	/**
	 * 在新增操作员的时候检查是否有重名的
	 * @param loginName
	 * @return
	 */
	String checkLoginName(String loginName);
	
	/**
	 * 操作员登录
	 * @param loginName
	 * @param pwd
	 * @return
	 */
	OperatorDetail login(String loginName, String pwd);
	
	/**
	 * 操作员增加
	 * @param od
	 * @return
	 */
	String addOperator(OperatorDetail od);
	
	/**
	 * 修改操作员
	 * @param od
	 * @return
	 */
	String modifyOperator(OperatorDetail od);
	
	/**
	 * 彻底删除操作员(数据删除)
	 * @param od
	 * @return
	 * @throws SystemException
	 */
	String deleteOperatorThorough(OperatorDetail od) throws SystemException;
	
	/**
	 * 查找子操作员的用户树
	 * @param parent
	 * @param content
	 * @return
	 */
	List getChildOperator(OperatorDetail parent, List content);
	
	/**
	 * 分页获取当前操作员子类列表
	 * @param od
	 * @param pageSize
	 * @param rowsPerPage
	 * @return
	 * @throws Exception
	 */
	public Page getOperatorListByParent(OperatorDetail od, int pageSize, int rowsPerPage) throws Exception;
	
	/**
	 * 根据权限标签查找该权限的执行action
	 * @param tag
	 * @return
	 * @throws SystemException
	 */
	String getAuthorizeAction(String tag) throws SystemException;
	
	/**
	 * 根据模块的标签查找该模块标签的执行action
	 * @param tag
	 * @return
	 * @throws SystemException
	 */
	String getModuleAction(String tag) throws SystemException;
	
	/**
	 * 根据模块ID获取模块明细
	 * @param mId
	 * @return
	 * @throws SystemException
	 */
	ModuleList getModule(Integer mId) throws SystemException;
	
	/**
	 * 获取权限列表
	 * @return
	 * @throws SystemException
	 */
	List getAuthorizeList() throws SystemException;
	
	/**
	 * 根据权限组的权限列表获取对应权限明细
	 * @param authorizeList    权限组中规定的权限列表
	 * @return
	 * @throws SystemException
	 */
	List getAuthorizeListByTag(String authorizeList) throws SystemException;
	
	/**
	 * 根据模块标签列表查找对应的模块明细列表
	 * @param moduleList
	 * @return
	 * @throws SystemException
	 */
	Map getModuleListByTag(String moduleList) throws SystemException;
	
	/**
	 * 列出所有模块
	 * @return
	 * @throws SystemException
	 */
	List getModuleList() throws SystemException;
	
	/**
	 * 根据权限组列表获取权限列表
	 * @param groups
	 * @return
	 * @throws SystemException
	 */
	Map getAuthorize(String groups) throws SystemException;
	
	AuthorizeList getAuthorizeByAction(String action) throws SystemException;
	
	AuthorizeList getAuthorize(Integer aid) throws SystemException;
	
	List getAuthorizesByGroup(Integer gid) throws SystemException;
	
	List getAuthorizesByModule(Integer mid) throws SystemException;
	
	OperatorDetail getOperatorDetail(String loginId);
	
	String checkModuleValidate(ModuleList module);
	
	String checkAuthorizeValidate(AuthorizeList authorize);
	
	String addModule(ModuleList module);
	
	String addAuthorize(AuthorizeList authorize);
	
	String modifyAuthorize(AuthorizeList authorize) throws SystemException;
	
	String deleteAuthorize(AuthorizeList authorize) throws SystemException;
	
	String checkGroupValidate(AuGroup group);
	
	String addGroup(AuGroup group);
	
	String modifyGroup(AuGroup group);
	
	AuGroup getGroup(Integer gid) throws SystemException;
	
	List getGroupListByModule(Integer mid) throws SystemException;
	
	List getGroupListByUser(String uid) throws SystemException;
	
	List getGroupList() throws SystemException;
	
	String deleteGroup(AuGroup group) throws SystemException;
	
	String modifyModule(ModuleList module) throws SystemException;
	
	Page getModuleLists(int pageSize, int rowsPerPage) throws Exception;
}
